#ifndef __WUZIQISERVER_H__
#define __WUZIQISERVER_H__

#include <iostream>
#include <string>
#include "stdTcpService.h"
#include "stdSqliteDataBase.h"
#include <map>
#include <queue>

extern std::queue<int> m_queue;
extern std::map<int,int> m_map;

class WUziqiServer
{
public:
    /* 构造函数 */
    WUziqiServer(const std::shared_ptr<StdTcpSocket> & clientSock);
    // ~MusicServer();
public:
    void handleRegisterInfo(const std::string & info);

    void handleLoginInfo(const std::string & info);
    
    void handleMatch(const std::string & info);

    void handlePlay(const std::string & info);

    void handleBack(const std::string & info);
    

private:
    /* 判断用户名是否存在 */
    bool userExist(const std::string & username);
    /* 根据文件路径获取文件内容 */
    //std::string readMusicInfo(const std::string & filePath);

private:

    std::shared_ptr<StdTcpSocket> m_clientSock;
    StdDataBase *db;
    /* key 为音乐名，value 为音乐路径*/
    
    

};

#endif //__MUSICSERVER_H__